package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
@TableName("t_products")
public class ProductBean {
    //编号  表示该列为主键列，value表示该列映射自动增长列
    // type=IdType.AUTO 表示该列的值使用自动增长列生成
    @TableId(value = "pk_productsId",type = IdType.AUTO)
    private Integer id;
    //商品名字
    @TableField("p_name")
    private String name;
    //生产日期
    @TableField("P_createDate")
    private LocalDate date;
    //价格
    @TableField("p_price")
    private Integer price;

    public ProductBean() {
    }

    public ProductBean(String name, LocalDate date, Integer price) {
        this.name = name;
        this.date = date;
        this.price = price;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", date=" + date +
                ", price=" + price +
                "}\n";
    }
}
